
<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>.:SMS Gateway JTK:.</title>
<?php echo $template['metadata']; ?>

<link rel="shortcut icon" href="asset/images/logojabar50.png" />
<link rel="stylesheet" media="screen" href="asset/css/reset.css" />
<link rel="stylesheet" media="screen" href="asset/css/grid.css" />
<link rel="stylesheet" media="screen" href="asset/css/style.css" />
<link rel="stylesheet" media="screen" href="asset/css/messages.css" />
<link rel="stylesheet" media="screen" href="asset/css/forms.css" />

<!--[if lt IE 9]>
<script src="asset/js/html5.js"></script>
<script src="asset/js/PIE.js"></script>
<![endif]-->
<!-- jquerytools -->
<script src="asset/js/jquery.tools.min.js"></script>
<script src="asset/js/jquery.ui.min.js"></script>

<!--[if lte IE 9]>
<link rel="stylesheet" media="screen" href="asset/css/ie.css" />
<script type="text/javascript" src="asset/js/ie.js"></script>
<![endif]-->



</head>
<body class="dashboard">
    <div class="login-box main-content">
		<header><h2><?php echo 'SMS' ?></h2></header>
		<section style="background: transparent url(asset/images/logojabar150.jpg) no-repeat 30px 10px;">
			
			<!-- <div class="closeable error message" style="margin-left: 20%">	 -->
			<div class="closeable info message" style="margin-left: 20%">
			<p><?php //echo "message cenah";?></p>
			<a href="step1.php"><b>Setting Device</b></a><br>
			<a href="step2.php"><b>Test Koneksi Device</b></a><br>
			<a href="step4.php"><b>Setting Konfigurasi</b></a><br>
			<a href="step5.php"><b>Install Service SMS</b></a><br>
			<a href="step6.php"><b>Menjalankan Service SMS</b></a><br>
			<a href="step7.php"><b>Kirim SMS</b></a><br>
			<a href="step8.php"><b>Inbox SMS</b></a><br>
			<a href="step9.php"><b>Menghentikan Service SMS</b></a></p>
			</div>	
			<?php //if($this->session->flashdata('error')) : ?>
			
			<div class="closeable info message" style="margin-left: 20%">
				<p><?php  ?></p>
				<h2>Setting SMS</h2>

<?php
$handle = @fopen("gammurc", "r");
$baris = array();
$i = 1;
$j = 1;
if ($handle) {
    while (!feof($handle)) {
        $buffer = fgets($handle);
        if (substr_count($buffer, 'port = ') > 0)
		{
		   if ($i == 1)
		   {
		      $split = explode("port = ", $buffer);
		      $port1 = str_replace(":", "", $split[1]);
		   }
		   
		   if ($i == 2)
		   {
		      $split = explode("port = ", $buffer);
		      $port2 = str_replace(":", "", $split[1]);
		   }
		   
		   if ($i == 3)
		   {
		      $split = explode("port = ", $buffer);
		      $port3 = str_replace(":", "", $split[1]);
		   }
		   
		   if ($i == 4)
		   {
		      $split = explode("port = ", $buffer);
		      $port4 = str_replace(":", "", $split[1]);
		   }
		   
		   $i++;
		}
		
		if (substr_count($buffer, 'connection = ') > 0)
		{
		   if ($j == 1)
		   {
 		      $split = explode("connection = ", $buffer);
		      $connection1 = $split[1];
		   }
		   
		   if ($j == 2)
		   {
 		      $split = explode("connection = ", $buffer);
		      $connection2 = $split[1];
		   }
		   
		   if ($j == 3)
		   {
 		      $split = explode("connection = ", $buffer);
		      $connection3 = $split[1];
		   }
		   
		   if ($j == 4)
		   {
 		      $split = explode("connection = ", $buffer);
		      $connection4 = $split[1];
		   }
		   
		   $j++;
		}
		
		$baris[] = $buffer; 
    }
    fclose($handle);
}

if ($_GET['op'] == "simpan")
{
  $port1 = $_POST['port1'];
  $connection1 = $_POST['connection1'];
  
  $port2 = $_POST['port2'];
  $connection2 = $_POST['connection2'];

  $port3 = $_POST['port3'];
  $connection3 = $_POST['connection3'];

  $port4 = $_POST['port4'];
  $connection4 = $_POST['connection4'];  
  
  $handle = @fopen("gammurc", "w");

  $text = "[gammu]\nport = ".$port1.":\nconnection = ".$connection1."\n[gammu1]\nport = ".$port2.":\nconnection = ".$connection2."\n[gammu2]\nport = ".$port3.":\nconnection = ".$connection3."\n[gammu3]\nport = ".$port4.":\nconnection = ".$connection4;
  
  fwrite($handle, $text);
  fclose($handle); 
  echo "<p>Konfigurasi sudah disimpan</p>";  
}

?> 

<p>Masukkan nomor port dan jenis connection pada form di bawah ini!</p>

<p><b>Modem/HP 1</b></p>

<form method="post" action="<?php $_SERVER['PHP_SELF']; ?>?op=simpan">
<table>
 <tr><td>PORT</td><td>:</td><td><input type="text" name="port1" value="<?php echo $port1;?>"></td></tr>
 <tr><td>CONNECTION</td><td>:</td><td><input type="text" name="connection1" value="<?php echo $connection1;?>"></td></tr>
</table>

<p><b>Modem/HP 2</b></p>

<table>
 <tr><td>PORT</td><td>:</td><td><input type="text" name="port2" value="<?php echo $port2;?>"></td></tr>
 <tr><td>CONNECTION</td><td>:</td><td><input type="text" name="connection2" value="<?php echo $connection2;?>"></td></tr>
</table>

<input type="submit" name="submit" value="Simpan">
</form>
			</div>			
			<?php echo $template['body']; ?>
			
		</section>
    </div>
</body>

<!-- Mirrored from themes.vivantdesigns.com/streamlined/ by HTTrack Website Copier/3.x [XR&CO'2010], Fri, 11 Nov 2011 09:04:44 GMT -->
</html>


